Field of the Invention
The present invention relates to a controller for controlling a machine tool and a robot, and more particularly, to a controller for controlling both a machine tool and a robot based on a single machining program.
Description of the Related Art
Conventionally, an operator of a machine tool generally performs so-called loading and unloading operations, such as workpiece mounting and removing operations. Recently, however, robots have come to be frequently used in these operations to continuously run the machine tool for a long time. In the case where a robot 200 for these operations is attached to a machine tool 100, as shown in FIG. 12, the machine tool 100 and the robot 200 are provided with a machine tool control unit 40 and a robot control unit 50, respectively, and a machining program 22 and a robot program 52 are delivered to these control units, individually.
In cooperatively operating the machine tool 100 and the robot 200 according to a first example of a control system for them shown in FIG. 12, a machine tool controller 2 and a robot controller 3 independent of each other are connected by a signal line or network, and an operation command signal and an operation completion signal are transferred between them. In the machine tool controller, a ladder program is used to coordinate the machining program 22 with these signals. The following is a description of a specific control method.
(1) The machine tool controller 2 controls the machine tool 100 based on the machining program 22. Further, the robot controller 3 controls the robot 200 based on the robot program 52.
(2) If the machine tool 100 requires operation of the robot 200, a robot work code, such as an M-code, in the machining program 22 is executed.
(3) When a robot work designation code in the machining program 22 is executed, the machine tool control unit 40 notifies a ladder program execution unit 60 of the execution of the robot work designation code.
(4) When notified of the execution of the robot work designation code, the ladder program execution unit 60 turns on the operation command signal for the robot according to the instruction of a ladder program 62. The operation command signal includes the type of the robot operation.
(5) When the robot control unit 50 detects the activation of the operation command signal, the robot controller 3 controls the robot 200 based on a relevant instruction in the robot program 52. When the movement of the robot 200 is completed, the robot control unit 50 turns on the operation completion signal.
(6) The ladder program execution unit 60 of the machine tool controller 2 notifies the machine tool control unit 40 of detected activation of the operation completion signal according to the instruction of the ladder program 62. Thereupon, the machine tool control unit 40 continues to control the machine tool 100 based on the machining program 22.
FIG. 13 is a diagram showing a second example of the control system for the machine tool 100 and the robot 200. In this example, both the machine tool 100 and the robot 200 are controlled by means of a single controller, in order to reduce an operator's labor for learning the operation of two types of controllers for the machine tool 100 and the robot 200.
The machine tool controller 2 manages both the machining program 22 for the machine tool 100 and the robot program 52 for the robot 200. In controlling the robot 200, the ladder program execution unit 60 of the machine tool controller 2 converts the robot program 52 to a corresponding operation command signal based on the instruction of the ladder program 62. This operation command signal includes the content of the operation of the robot 200, that is, the behavior of the robot 200. The ladder program 62 is used to coordinate the machining program 22 for the machine tool 100 with the robot program 52 for the robot 200.
Japanese Patent Application Laid-Open No. 6-149329 discloses a robot controller comprising a CPU for controlling a machine tool, a CPU for controlling a robot, and a shared RAM interposed between these CPUs. This controller is configured so that the CPU for controlling the robot receives a robot program from both commands from an external device and a control panel.
Japanese Patent Application Laid-Open No. 6-134652 discloses a control method for a robot hand of a numerical control machine tool, in which the robot hand is attached to a tool mounting portion of the machine tool so that it can be position-controlled and opened or closed by NC language.
According to the technique shown in FIG. 12, the machining program and the robot program are activated independently of each other. To achieve cooperative operations of the machine tool and the robot, data including the type of operation, timing for the start of operation, etc., are transferred between the machining program and the robot program.
The ladder program is used for the transfer of these data. Since the ladder program includes processing for the basic control of the machine tool, only the manufacturer of the machine tool is allowed to edit it, and users are not. Therefore, the machine tool manufacturer determines specifications for the way the machine tool and the robot cooperate with each other and provides a ladder program to achieve the specifications.
Consequently, the machine tool manufacturer is expected to create the ladder program for the cooperative operations of the machine tool and the robot, thus suffering increased burden in program creation.
Since the mechanism of the coordination is achieved by the ladder program, on the other hand, a user cannot add any new functions, thus proving poor extensibility. While work instructions from the user are given in the form of digital codes, such as M-codes, the number of types of work instructions that can be given from the machining program to the robot program depends on the specifications determined by the machine tool manufacturer. Thus, any of the available work instructions is expected to be based on the specifications, so that the user is not allowed to add new types of work instructions afterward.
Normally, the workpiece loading and unloading operations and the like are previously assumed and incorporated in the ladder program by the machine tool manufacturer. If the user intends to additionally cause the machine tool and the robot to cooperatively carry out various operations related to machining, however, he/she cannot add any new functions to the ladder program. If the user dare add a new function, he/she must ask the machine tool manufacturer to modify the ladder program, thus suffering increased burden.
Since the machining program and the robot program are independent of each other, moreover, it is sometimes difficult to understand from the programs how the machine tool and the robot behave if they are simultaneously operated, for example, in particular. If the behaviors of the machine tool and the robot cannot be easily understood from the programs, identification of the operation is so time-consuming that the user suffers increased burden in start-up operation.
Also in the technique shown in FIG. 13, the machine tool controller 2 manages both the machining program 22 and the robot program 52. Since the ladder program is still used to coordinate the machining program with the robot program, however, this technique has the same problem with the technique shown in FIG. 12.
According to the technique disclosed in Japanese Patent Application Laid-Open No. 6-149329, the robot program for controlling the robot is configured to be received from the command from the external device or the command from the control panel, so that it is independent of the machining program for controlling the machine tool. In some cases, therefore, it is difficult to understand how the machine tool and the robot behave.
According to the technique disclosed in Japanese Patent Application Laid-Open No. 6-134652, in contrast, the robot hand is mounted in a tool mounting position on the machine tool so that it can be position-controlled and opened or closed by NC language. This “robot hand” is attached to the tool mounting portion of the machine tool, not of the robot, and is controlled and driven by the control axis of the numerical control machine tool, so that it should naturally be regarded as a part of the machine tool. Since the operating range of the robot hand is limited to that of the control axis of the machine tool, moreover, it is difficult for the user to perform various operations related to machining along with the loading and unloading operations by means of the robot hand.